gtkscrolledwindow: Change lifetime of kinetic scroll helpers
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 15 Mar 2022 21:01:36 +0000 (22:01 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 19 Mar 2022 11:35:11 +0000 (12:35 +0100)
commitdf40db137b8d881605ef7a487ea6ff4fda7d1bde
treeb7a9c69f3f578b12e1f2e6c93bfe6dd3acc075f8
parent129bc27d5336a9789602ab26c42790fe71da76c3
gtkscrolledwindow: Change lifetime of kinetic scroll helpers

In order to properly accumulate scroll velocities, we need to keep
the kinetic scroll helpers after we have possibly stopped them
in the process of initiating a further scroll flick.

So, instead of stopping (and destroying) those helpers on scroll-begin,
keep them until the next scroll-end if a scroll was initiated before
kinetic scroll finished. This way we can fetch the last velocity when
calculating the extra kick.

In order to ensure the helpers don't live beyond what it is expected,
we now also remove them after a finished hold event.

Fixes the accumulation of scrolling velocity on consecutive scroll
sequences.
gtk/gtkscrolledwindow.c